•  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
r9 vs r10
... ...
9 9
*CentOS 7 은 작성일 기준 EOS(서비스 지원 중단) 되었지만, 라이브 환경에 가장 많이 설치되어있는 버전입니다.
10 10
11 11
*''본 문서는 기본적인 구성에 대한 이해를 돕기 위한 문서이며 실제 라이브 환경의 파티션 구성 및 상세 설정은 다를 수 있습니다.''
12
13
14 14
== 설치 USB 만들기 ==
15 15
=== ISO 다운로드 ===
16 16
[[https://vault.centos.org/7.9.2009/isos/x86_64/|CentOS 7.9 ISO 다운로드]]
17
17
[[파일:CentOS_7_설치가이드_1-1.png|width=65%]]
18 18
*CentOS-7-x86_64-Minimal-2009.iso : 최소 설치 버전의 ISO
19 19
*CentOS-7-x86_64-DVD-2009.iso : 기본 설치 버전의 ISO
20 20
*CentOS-7-x86_64-Everything-2009.iso : 전체 설치 버전의 ISO
... ...
35 35
== 환경 구성 ==
36 36
=== resolv.conf 수정 ===
37 37
{{{[root@localhost ~]# vi /etc/resolv.conf
38
38
...
39 39
nameserver 8.8.8.8
40
...
41 41
}}}
42 42
resolv.conf 설정 이후 원격 재 접속 시 dns 질의가 발생하여 접속이 느려질 수 있습니다.
43 43
해당 경우 resolv.conf에서 nameserver 삭제 후 재 접속 하면 해결 가능합니다.
... ...
82 82
*변경사항 적용{{{ [root@localhost ~]# yum install epel-release
83 83
}}}
84 84
=== hostname 설정 ===
85
85
{{{ [root@localhost ~]# hostnamectl set-hostname testServer --static
86
}}}
87
--static 옵션을 사용하면 대소문자를 구분하여 적용됩니다.
86 88
=== 부팅 시 런레벨 설정 ===
87
89
{{{ [root@localhost ~]# systemctl set-default multi-user.target
90
[root@localhost ~]# systemctl get-default
91
multi-user.target
92
}}}
88 93
=== selinux 해제 ===
89
94
{{{[root@localhost ~]# vi /etc/sysconfig/selinux
95
...
96
SELINUX=disabled
97
...
98
}}}
90 99
=== 방화벽 해제 ===
100
{{{[root@localhost ~]# systemctl disabled --now firewalld
101
}}}
93 102
94 103
=== 불필요한 데몬 종료 ===
95
104
{{{[root@localhost ~]# systemctl disable --now NetworkManager
105
[root@localhost ~]# systemctl disable --now abrt-ccpp
106
[root@localhost ~]# systemctl disable --now abrtd
107
[root@localhost ~]# systemctl disable --now atd
108
[root@localhost ~]# systemctl disable --now auditd
109
[root@localhost ~]# systemctl disable --now kdump
110
[root@localhost ~]# systemctl disable --now netconsole
111
[root@localhost ~]# systemctl disable --now messagebus
112
}}}
113
데몬 종료 후 su 실행이 느려지면 {{{ systemctl restart systemd-logind }}}실행하면 됩니다.
96 114
=== swap 파티션 해제 ===
97
115
{{{[root@localhost ~]# swapoff -a
116
[root@localhost ~]# sed -i.bak -r 's/(.+ swap .+)/#\1/' /etc/fstab
117
}}}
98 118
=== 시간 동기화 설정 ===
119
{{{[root@localhost ~]# yum install -y chrony
120
[root@localhost ~]# systemctl enable --now chronyd
121
[root@localhost ~]# systemctl status chronyd
122
[root@localhost ~]# chronyc sources
103 123
124
}}}
105 125
=== ssh 보안 설정 ===
126
{{{[root@localhost ~]# vi /etc/ssh/sshd_config
127
...
128
Port 2233
129
...
130
PermitRootLogin no
131
...
132
MaxAuthTries 3
133
...
134
X11Forwarding yes
135
...
136
}}}
117 137
118 138
=== 일반 사용자 생성 ===
139
{{{[root@localhost ~]# useradd -d /home/sysadmin -s /bin/bash sysadmin
140
[root@localhost ~]# passwd sysadmin
121 141
122
=== 일반 사용자의 root 접근 권한 설정 sudo ===
123
142
New password: 패스워드 입력
143
Retype new password: 패스워드 입력
144
passwd: all authentication tokens updated successfully
145
}}}
146
=== 일반 사용자의 root 접근 권한 설정 (sudo) ===
147
*su 명령어와 관련된 PAM 설정 파일
148
{{{[root@localhost ~]# vi /etc/pam.d/su
149
}}}
150
*아래 줄 주석 해제
151
{{{...
152
auth required pam_wheel.so use_uid
153
...
154
}}}
155
*일반 사용자의 변경된 권한 적용
156
{{{[root@localhost ~]# gpasswd -a sysadmin wheel
157
[root@localhost ~]# chgrp wheel /usr/bin/su
158
[root@localhost ~]# chmod 4750 /usr/bin/su
159
}}}
124 160
=== 필수 패키지 설치 ===
125
161
{{{[root@localhost ~]# yum install yum-utils net-tools wget
162
}}}
126 163
=== 파티션 설정 ===
127 164
128 165
=== 본딩 설정 ===